package com.jh.user.pojo.enums;

import org.apache.commons.lang3.StringUtils;

public enum PayTypeQu {
    /**
     * 交易
     */
    TRADE("TRADE", "交易"),

    /**
     * 单笔提现费
     */
    WITHDRAW_SIGLE("WITHDRAW_SIGLE", "单笔提现"),

    /**
     * 提现费率
     */
    WITHDRAW_RATE("WITHDRAW_RATE", "提现"),

    ;

    private final String value;
    private final String desc;

    PayTypeQu(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static <T extends String> PayTypeQu of(T n) {
        String val;
        val = n;
        if (StringUtils.isEmpty(val)) {
            return null;
        }
        for (PayTypeQu payTypeQu : values()) {
            if (payTypeQu.getValue().equals(val)) {
                return payTypeQu;
            }
            if (payTypeQu.getDesc().equals(val)) {
                return payTypeQu;
            }
        }
        return null;
    }
}
